import request from "@/utils/request";
// 调用权限
export default {
  getList(data) {
    return request({
      url: "/api/goods/",
      method: "get",
      params: data
    });
  },
  toAdd(data) {
    return request({
      url: "/api/goods/",
      method: "post",
      data
    });
  },
  toDelete(id) {
    return request({
      url: "/api/goods/" + id + "/",
      method: "delete"
    });
  },
  toEdit(id, data) {
    return request({
      url: "/api/goods/" + id + "/",
      method: "put",
      data
    });
  },
  restock(id, data) {
    return request({
      url: "/api/goods/" + id + "/restock/",
      method: "put",
      data
    });
  },
  //判断物品数量是否充足
  goodsQuantity(id, data) {
    return request({
      url: "/api/goods/"+id+"/quantity/",
      method: "get",
      params:data
    });
  },
  getSimleList(data) {
    return request({
      url: "/api/goods/simple/",
      method: "get",
      params: data
    });
  },
};
